<template>
<!-- 这是填写简历页面 审核页 -->
    <div id="examine">
        <div class="Header-wrapper">
            <yd-navbar title="审核简历" fontsize="16px" color="#fff" height="45px" bgcolor="#ffd602">
                <div @click="DeliveryList" slot="left">
                    <i class="iconfont icon-back Fcolor"></i>
                </div>
            </yd-navbar>
        </div>
        <div class="information-wrapper">
        <div class="msg-portrait">
            <div class="head-portrait">
                <span class="portrait-box">
                  <i class="iconfont icon-touxiang fsize"></i>
                </span>
            </div>
            <div class="information-content">
                <ul>
                    <li>
                        <span>{{userdata.name}}</span>
                        <span v-if='userdata.sex===2'>女</span>
                        <span v-else>男</span>
                    </li>
                    <li>手机：{{userdata.phone}}</li>
                    <li>{{userdata.deptname}}</li>
                </ul>
            </div>
        </div>
    </div>
        <div class="write-wrapper">
        <div id="resume-box-list">
          <ul>
            <li>
                <group>
                    <cell
                    :arrow-direction="off ? 'up' : 'down'"
                    @click.native="off = !off"
                    >
                    <span v-if="!off" slot="title" class="foldS1">教育经历</span>
                    <span v-else slot="title" class="foldS2">教育经历</span>
                    <i :class="off?' iconfont icon-jianhao':'iconfont icon-add'"></i>
                    </cell>
                    <div class="slide" :class="off?'animate':''" >
                       <div class="slide-center" v-for='(list,index) in itemData' :key='index'>
                            <p v-if='list.begindate'>时间：{{list.begindate.split(' ')[0]}}---{{list.enddate.split(' ')[0]}}</p>
                            <p v-if='list.school'>学校：{{list.school}}</p>
                            <p v-if='list.zhuanye'>主修专业:{{list.zhuanye}}</p>
                            <p v-if='list.goodat'>兴趣爱好:{{list.goodat}}</p>
                        </div>
                    </div>
                </group>
            </li>
            <li>
                <group>
                    <cell
                    :arrow-direction="off2 ? 'up' : 'down'"
                    @click.native="off2 = !off2"
                    >
                    <span v-if="!off2" slot="title" class="foldS1">应聘优势</span>
                    <span v-else slot="title" class="foldS2">应聘优势</span>
                     <i :class="off2?' iconfont icon-jianhao':'iconfont icon-add'"></i>
                    </cell>
                    <div class="slide" :class="off2?'animate':''">
                        <div class="slide-center" v-for="(list2,index) in itemData1" :key='index'>
                            <p v-if="list2.ypys">{{list2.ypys}}</p>
                        </div>
                    </div>
                </group>
            </li>
            <li>
                 <group>
                    <cell
                    :arrow-direction="off1 ? 'up' : 'down'"
                    @click.native="off1 = !off1"
                    >
                    <span v-if="!off1" slot="title" class="foldS1">社会实践</span>
                    <span v-else slot="title" class="foldS2">社会实践</span>
                     <i :class="off1?' iconfont icon-jianhao':'iconfont icon-add'"></i>
                    </cell>
                    <div class="slide" :class="off1?'animate':''">
                         <div class="Q-wrapper">
                            <div class="Q" v-for="(item,index) of itemData2" :key="index">
                                <label>{{index+1}}.{{item.question}}</label>
                                <div class="radio-wrapper">
                                  <span>选择：</span>
                                  <span v-if="item.answer ==='1'">是</span>
                                  <span v-else>否</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </group>
            </li>
          </ul>
      </div>
    </div>
      <div id="resume-box-foot">
          <li @click="Refuse"><span>拒绝</span></li>
          <li  @click="by"><span>通过</span></li>
      </div>
    </div>
</template>
<script type="text/babel">
import { Group, Cell } from 'vux'
import apis from '../../../../../static/js/apis.js'
export default {
  data () {
    return {
      userdata: [],
      itemData: [],
      itemData2: [],
      itemData1: [],
      id: '',
      id1: '',
      off: true,
      off1: true,
      off2: true,
      show: false
    }
  },
  components: {
    Group,
    Cell,
    apis
  },
  methods: {
    DeliveryList () {
      window.history.go(-1)
    },
    Refuse () {
      this.$axios.post(apis + '/app/jobresume/savestate', this.confusion(JSON.stringify({
        id: this.id + '',
        jobresumeid: this.id1 + '',
        state: 'not'
      })
      ),
      {
        headers: {
          Authorization: 'Bearer ' + JSON.parse(window.localStorage.getItem('userInfo')).token,
          'Content-Type': 'application/json;charset=UTF-8',
          'Cache-Control': 'no-cache',
          isApp: 'isApp'
        }
      }
      )
        .then(response => {
          this.itemData = response.data
          this.$dialog.toast({
            mes: '已拒绝',
            callback: () => {
              window.history.go(-1)
            }
          })
        })
        .catch(error => {
          console.log(error)
          this.$dialog.toast({
            mes: '服务器异常'
          })
        })
    },
    by () {
      this.$axios.post(apis + '/app/jobresume/savestate', this.confusion(JSON.stringify({
        id: this.id + '',
        jobresumeid: this.id1 + '',
        state: 'pass'
      })
      ),
      {
        headers: {
          Authorization: 'Bearer ' + JSON.parse(window.localStorage.getItem('userInfo')).token,
          'Content-Type': 'application/json;charset=UTF-8',
          'Cache-Control': 'no-cache',
          isApp: 'isApp'
        }
      }
      )
        .then(response => {
          this.itemData = response.data
          //   console.log(this.itemData)
          this.$dialog.toast({
            mes: '已通过',
            callback: () => {
              window.history.go(-1)
            }
          })
        })
        .catch(error => {
          console.log(error)
          this.$dialog.toast({
            mes: '服务器异常'
          })
        })
    }
  },
  created () {
    this.id = this.$route.query.id
    this.id1 = this.$route.query.id1
    this.$axios.post(apis + '/app/school/getresume',
      this.confusion(JSON.stringify({
        userid: this.id + ''
      })
      ),
      {
        headers: {
          Authorization: 'Bearer ' + JSON.parse(window.localStorage.getItem('userInfo')).token,
          'Content-Type': 'application/json;charset=UTF-8',
          'Cache-Control': 'no-cache',
          isApp: 'isApp'
        }
      }
    )
      .then(response => {
        this.userdata = response.data.user
        this.itemData = response.data.school
        this.itemData2 = response.data.question
        this.itemData1 = response.data.ypys
      })
      .catch(error => {
        console.log(error)
        this.$dialog.toast({
          mes: '服务器异常'
        })
      })
  }
}
</script>
<style scoped>
.slide-center{
    width: 100%;
    overflow: hidden;
    float: left;
    border-bottom: 1px #ffd602 dashed;
    padding: 10px 0;
    margin-top: 10px;
}
.slide-center:nth-last-of-type(1){
    border-bottom: none;
}
.resume-box-content ul{
    display: block;
    width: 100%;
    height: 178px;
    background: #fff;
}
.resume-box-content ul li{
    padding: 0 12px;
}
.resume-box-content ul li:nth-of-type(1){
    text-align: center;
    overflow: hidden;
    float: left;
}
.user-img{
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 50px 0 0 12px;
    line-height: 80px;
    text-align: center;
}
.user-img img{
    width: 100%;
    height: 100%;
}
.resume-box-content ul li:nth-of-type(2){
    height: 100%;
    padding-top: 58px;
    text-indent: 10px;
    float: left;
}
.resume-box-content ul li:nth-of-type(2) span{
    display: block;
    line-height: 25px;
}
.resume-box-content ul li:nth-of-type(3){
    line-height: 250px;
    height: 100%;
    float: right;
}
.resume-box-content ul li:nth-of-type(3) span{
    display: block;
    margin: 25px 0 0 0px;
    color: #fff;
    border-radius: 5px;
    width: 35px;
    text-align: center;
    height: 20px;
    background: #ffd602;
    line-height: 20px;
}
.icon-touxiang{
    font-size: 80px;
    margin: 0 auto;
    display: block;
    color: #ffd602;
}
.icon-add{
    color: #ffd602;
}
.icon-jianhao{
    color: #ffd602;
}
#resume-box-list ul li:nth-of-type(1){
    border-top: 2px solid #dfdfdf;
}
.weui-cell{
    height: 40px!important;
    background: #fff!important;
    margin-top: 0!important;
}
.yd-btn-block{
    margin: 0;
}
.yd-button{
    height: 40px;
    padding: 0 40px;
}
.yd-btn-primary{
    background: #f0f0f0;
}
.auto p{
    width: 100%;
    height: 200px;
}
.auto p .span1{
    display: inline-block;
    width: 100%;
    height: 200px;
    line-height: 200px;
    margin: 0 auto;
    text-align: center;
}
.auto p .span2{
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    display: inline-block;
    position: absolute;
    right: 0px;
    top: 0px;
}
.weui-cell{
    height: 15px;
}
.foldS1{
    font-size: 16px;
}
.slide{
    background: #fff;
    padding: 0 15px;
    overflow: hidden;
    max-height: 0;
    color: #000;
    font-size: 12px;
    transition: max-height .5s cubic-bezier(0, 1, 0, 1) -.1s;
}
img{
    width: 100%;
}
.animate{
    max-height: 9999px;
    transition-timing-function: cubic-bezier(0.5, 0, 1, 0);
    transition-delay: 0s;
}
p{
    width: 100%;
    height: auto;
    line-height: 30px;
    text-align: left;
}
.foldS2{
    color: #000;
    float: left;
    font-size: 14px;
}
.Fcolor {
  color: #fff;
}
.icon-back{
  font-size: 24px;
}
.write-wrapper {
    width: 100%;
    overflow-y: auto;
    position: fixed;
    top: 177px;
    bottom: 50px;
    background: #fff;
}
.information-wrapper {
    width: 100%;
    height: 132px;
    padding:24px 12px;
    display: flex;
    justify-content: space-around;
    border-bottom: 2px solid #DFDFDF;
    background: #fff;
    overflow: hidden;
}
.msg-portrait{
    flex: 8;
}
.head-portrait {
   margin-right: 15px;
   float: left;
}
.portrait-box{
    display: block;
    width: 70px;
    border-radius: 50%;
    line-height: 70px;
    text-align: center;
    overflow: hidden;
    margin-top: 5px;
    height: 70px;
}
.head-portrait img {
    width: 100%;
    border-radius: 50%;
    height: 100%;
}
.information-content {
    width: 150px;
    float: left;
}
.information-content ul {
    color: #333;
    width: 100%;
    line-height: 24px;
    font-size: 14px;
}
.fsize{
    font-size: 70px;
    color: #ffd602;
}
#resume-box-foot{
    display: flex;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 50px;
    line-height: 50px;
    background: #f0f0f0;
}
#resume-box-foot li{
    flex: 1;
    line-height: 40px;
}
#resume-box-foot li span{
    display: block;
    width: 80%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border: 1px solid #ffd602;
    margin: 6px auto;
}
#resume-box-foot li:nth-of-type(2) span{
    color: #fff;
    background: #ffd602;
}
#resume-box-list{
    margin-bottom: 20px;
}
#resume-box-list ul{
    width: 100%;
    height: 100%;
    margin-bottom: 20px;
}
#resume-box-list ul li{
    width: 100%;
    height: auto;
    line-height: 40px;
    text-align: center;
    font-size: 14px;
    color: #ffd602;
    border-bottom: 1px solid #dfdfdf;
}
.write-wrapper {
    width: 100%;
    overflow-y: auto;
    position: fixed;
    top: 176px;
    bottom: 50px;
    background: #fff;
}
.foot-content{
    width: 80%;
    height: 80%;
    line-height: 43px;
    margin: 0 auto;
    background: #ffd602;
    border-radius: 12px;
}
#resume-box-foot{
    position: fixed;
    bottom: 0;
    width: 100%;
}
.after-fill span {
    line-height: 34px;
    text-align: center;
    font-size: 14px;
    color: #FFD602;
}
.Q-wrapper{
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding: 10px 0;
    margin-top: 10px;
}
.Q{
    text-align: left;
    overflow: hidden;
    margin-bottom: 10px;
}
.Q label{
    font-size: 14px;
    color: #333;
}
.radio-wrapper{
    width: 100%;
    margin: 10px 0;
}
</style>
